package com.yupi.yu_picture.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yupi.yu_picture.api.aliyunai.model.CreateOutPaintingTaskResponse;
import com.yupi.yu_picture.model.dto.picture.*;
import com.yupi.yu_picture.model.entity.Picture;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yu_picture.model.entity.User;
import com.yupi.yu_picture.model.vo.PictureVO;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 41722
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-03-22 22:24:49
*/
@Service
public interface PictureService extends IService<Picture> {
    /**
     * 上传图片
     *
     * @param
     * @param pictureUploadRequest
     * @param loginUser
     * @return
     */
    PictureVO uploadPicture(Object inputSource,
                            PictureUploadRequest pictureUploadRequest,
                            User loginUser);

    QueryWrapper<Picture> getPictureQueryWrapper(PictureQueryRequest pictureQueryRequest);

    PictureVO getPictureVO(Picture picture, HttpServletRequest request);



    List<PictureVO> searchPictureByColor(Long space, String picColor, User loginUser);

    Page<PictureVO> getPictureVoPage(Page<Picture> picturePage, HttpServletRequest request);

    //编写校验图片方法，用于更新和修改图片时进行判断
    void validPicture(Picture picture);

    /**
     * 图片审核
     *
     * @param pictureReviewRequest
     * @param loginUser
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, User loginUser);

    void fillReviewParams(Picture picture,User user);

    Integer uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest,User loginUser);
    void clearPictureFile(Picture oldPicture);

    void  checkPictureAuth(User loginUser, Picture picture);
    void deletePicture(User loginUser,Long pictureId);

    void editPicture(PictureEditRequest pictureEditRequest, User loginUser);

    void editPictureByBatch(PictureEditByBatchRequest pictureEditByBatchRequest, User loginUser);

    CreateOutPaintingTaskResponse createPictureOutPaintingTask(CreatePictureOutPaintingTaskRequest createPictureOutPaintingTaskRequest, User loginUser);
}
